package cn.fxyz.cart;

import cn.fxyz.entity.Food;

/**
 * 购物项对象
 * 
 *
 */
public class CartItem {
	private Food food;		// 购物项中商品信息
	private int foodCount;			// 购买某种商品数量
	private double subtotal;	// 购买某种商品小计
	
	
	
	public Food getFood() {
		return food;
	}
	public void setFood(Food food) {
		this.food = food;
	}
	
	public int getFoodCount() {
		return foodCount;
	}
	public void setFoodCount(int foodCount) {
		this.foodCount = foodCount;
	}
	public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}
	// 小计自动计算的.
	public double getSubtotal() {
		return foodCount * food.getPrice();
	}
	/*public void setSubtotal(double subtotal) {
		this.subtotal = subtotal;
	}
	*/
	
}
